﻿using AppSettings;
using KEngine;
using UnityEngine;

public static class LuaConst
{
//    public static string luaDir = GameConfigSettings.Get("LuaPath").Value;
//    public static string toluaDir = GameConfigSettings.Get("ToLuaPath").Value; 
    public static string luaDir = getluaDir();
    public static string toluaDir = getToluaDir();

#if UNITY_STANDALONE
    public static string osDir = "Win";
#elif UNITY_ANDROID
    public static string osDir = "Android";            
#elif UNITY_IPHONE
    public static string osDir = "iOS";        
#else
    public static string osDir = "";        
#endif

    public static string luaResDir = string.Format("{0}/{1}/Lua", Application.persistentDataPath, osDir);      //手机运行时lua文件下载目录    

#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN    
    public static string zbsDir = "D:/ZeroBraneStudio/lualibs/mobdebug";        //ZeroBraneStudio目录       
#elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
	public static string zbsDir = "/Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/lualibs/mobdebug";
#else
    public static string zbsDir = luaResDir + "/mobdebug/";
#endif    

    public static bool openLuaSocket = true;            //是否打开Lua Socket库
    public static bool openLuaDebugger = false;         //是否连接lua调试器

    public static string getluaDir()
    {
        if (AppEngine.GetConfig("KEngine", "Debug") == "1")
        {
            return AppEngine.GetConfig("ToLUA", "LuaPath");
        }
        else
        {
            return Application.dataPath +AppEngine.GetConfig("KEngine", "LuaPath");

        }
    }
    public static string getToluaDir()
    {
        return Application.dataPath + AppEngine.GetConfig("ToLUA", "ToLuaPath");
    }
}